using GLib;

namespace Rob
{
	namespace Actions
	{
		class RunCommand: Rob.Actions.Action
		{
			private string _cmd;
			private string _name;
			private string _title;
			public string cmd
			{
				set{_cmd = value;}
				get{return _cmd;}
			}
			public bool load(string name, KeyFile kf)
			{
				if(kf.has_group(name))
				{
					_cmd = kf.get_string(name, "cmd");
					_name = name;
					_title = kf.get_string(name, "title");
				}
				else
					return false;
			}
			public bool save(KeyFile kf)
			{
				if(!kf.has_group(_name))
					kf.set_group(_name);
				kf.set_string(name,"cmd",cmd);
				kf.set_string(name,"title",cmd);
			}
			construct 
			{
				_cmd = new string("");
				_name = new string("");
			}
			[ModuleInit]
			public Type register_rb_plugin (TypeModule module) 
			{
				stdout.printf ("Registering plugin %s\n", "RunCommand");
				return typeof (RunCommand);
			}
		}
	}
}
